package algorithms;

/**
 * @功能
 * @创建时间 2020/5/17
 */
public class MakeNum {
    public static int[] makeNo(int size){
        if(size == 1){
            return new int[] {1};
        }
        int halfSize = (size + 1) /2;
        int[] base = makeNo(halfSize);
        int[] ans = new int[size];
        int index = 0;
        for(;index<halfSize;index++){
            ans[index] = base[index]*2+1;
        }
        for (int i =0;index< size;index++,i++){
            ans[index] = base[i]*2;
        }
        return ans;
    }
}
